66 WDT_A_hold(WDT_A_BASE);
84 GPIO_setAsPeripheralModuleFunctionOutputPin(
87 GPIO_FUNCTION_SACOA0O);
88 GPIO_setAsPeripheralModuleFunctionInputPin(
91 GPIO_FUNCTION_SACOA0N);
92 GPIO_setAsPeripheralModuleFunctionInputPin(
95 GPIO_FUNCTION_SACOA0P);
96 GPIO_setAsPeripheralModuleFunctionOutputPin(
99 GPIO_FUNCTION_SACOA2O);
100 GPIO_setAsPeripheralModuleFunctionInputPin(
103 GPIO_FUNCTION_SACOA2N);
104 GPIO_setAsPeripheralModuleFunctionInputPin(
107 GPIO_FUNCTION_SACOA2P);
113 SAC_OA_POSITIVE_INPUT_SOURCE_EXTERNAL,
114 SAC_OA_NEGATIVE_INPUT_SOURCE_PGA);
116 SAC_OA_selectPowerMode(
118 SAC_OA_POWER_MODE_LOW_SPEED_LOW_POWER);
126 SAC_PGA_MODE_NONINVERTING);
128 SAC_OA_enable(SAC2_BASE);
130 SAC_enable(SAC2_BASE);
135 SAC_OA_POSITIVE_INPUT_SOURCE_PAIR_OA,
136 SAC_OA_NEGATIVE_INPUT_SOURCE_PGA);
138 SAC_OA_selectPowerMode(
140 SAC_OA_POWER_MODE_LOW_SPEED_LOW_POWER);
144 SAC_PGA_GAIN_BIT0 | SAC_PGA_GAIN_BIT1);
148 SAC_PGA_MODE_NONINVERTING);
150 SAC_OA_enable(SAC0_BASE);
152 SAC_enable(SAC0_BASE);
159 ADC_SAMPLEHOLDSOURCE_SC,
160 ADC_CLOCKSOURCE_ADCOSC,
163 ADC_setupSamplingTimer(
165 ADC_CYCLEHOLD_16_CYCLES,
166 ADC_MULTIPLESAMPLESDISABLE);
168 ADC_enable(ADC_BASE);
172 ADC_RESOLUTION_12BIT);
176 ADC_COMPLETED_INTERRUPT);
193 __bis_SR_register(LPM0_bits | GIE);
213 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
214 #pragma vector=ADC_VECTOR
216 #elif defined(__GNUC__)
217 void __attribute__ ((interrupt(ADC_VECTOR)))
ADC_ISR (
void)
219 #error Compiler not supported!
222 switch(__even_in_range(ADCIV, ADCIV_ADCIFG))
228 case ADCIV_ADCTOVIFG:
__bic_SR_register_on_exit(LPM3_bits|GIE)
GPIO_setOutputHighOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)
GPIO_setOutputLowOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)